The present invention relates in general to CRC error checking, and in particular to a switching platform that computes a sequence-level CRC value for data incoming and outgoing data that uses the ANSI standard fibre channel interface.
In conventional networked systems, data is often transmitted between digital devices over a variety of protocols. Switching platforms exist that are capable of converting and switching data from one protocol to another. For instance, data can be transmitted by an IBM mainframe over an ESCON channel protocol. A switching platform can receive such an ESCON data stream and redirect the data over a different bus protocol like SCSI, or even a network media such as ATM. Using such devices, IBM mainframes can communicate to otherwise incompatible devices such as a SCSI storage device using a known protocol like ESCON.
Switching platforms may also allow remote access to devices that are physically located beyond the limits of a particular communications media. For instance, local fibre channel data streams can be converted to a wide area network such as ATM and then be transmitted across the continent. A separate switching platform at the receiving site can receive the network protocol data stream and convert it back to the original channel protocol or even another protocol altogether, whatever is appropriate for the receiving device.
As is well known, it is important that any data corruption along a transmission path be identified and corrected. Standard techniques for detecting data corruption include parity checks and CRCs (or cyclic redundancy checks). Parity checks require that an additional bit be added onto each byte of transmitted data. The additional bit is selected so that the entire byte contains either an odd number of xe2x80x98onexe2x80x99 bits (odd parity) or an even number of xe2x80x98onexe2x80x99 bits (even parity). Unfortunately, this error detection scheme does not check errors that create an even number of bit errors within a single byte.
The CRC technique is an improvement over simpler methods of error detection. In standard techniques, a CRC value is appended onto a grouping of data during data transmission. When the data is received, a new CRC value is calculated and compared with the original value. If the values do not match, there has been a transmission error. Alternatively, the data and the appended CRC value are combined to calculate a CRC value, which can then be compared with a constant to determine if there were any errors during transmission.
While various channel and networking protocols check for point-to-point data transmission problems using parity checking and CRC values, these end-to-end techniques are not useful in discovering data transmission problems within the switching platform domain. In other words, if transmission errors arise in the transmission from one switching platform to another, it would be inefficient to require the destination (i.e., the remote storage device) to discover the transmission problem and then request a retransmission from the source (i.e., the computer).
What is needed is a technique to calculate and check CRC values in a switching platform domain beyond that provided by the basic point-to-point protocols used by the attached devices. Specifically, what is needed is a method and device that snoops the hardware used for normal fibre channel communications to create a sequence-level CRC generator and checker.
These needs are met by the present invention technique for performing a sequence-level CRC calculation. The present invention utilizes a CRC generator to monitor data communication on a fibre channel interface. The interface is preferably used to receive and transmit data between a switching platform domain and a fibre channel connection. This switching platform uses CRC error checking to ensure data integrity within the switching platform domain.
The CRC generator monitors data flowing through the fibre channel interface for frames that contain the type of data for which a sequence-level CRC is desired, such as for a sequence containing SCSI data. When found, the CRC generator performs an 8B/10B decode, strips off any fill bytes, and performs a CRC calculation on the data payload.
If the found frame is the first frame in the sequence, the CRC calculation starts with a reset value. If the frame is not the first, an intermediate value containing the previous CRC calculation results for this sequence is retrieved and used to perform the CRC calculation. Upon completion of the calculation for the frame, a determination is made whether the sequence is complete. If so, the calculated value is the sequence-level CRC. If not, the calculated value is stored in memory for use with the next frame in that sequence.
With inbound data, the calculated sequence-level CRC is appended to the end of the data for that sequence. With outbound data, the calculated value is compared with the appended, expected value, and a CRC error is generated if the values do not match. The sequence-level CRC value appended to the sequence data payload is removed before the data exits the switching platform domain.